<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Proton - Admin Template</title>

    <!-- Import google fonts - Heading first/ text second -->

    <!--[if lt IE 9]>
    <link href="http://fonts.useso.com/css?family=Open+Sans:400" rel="stylesheet" type="text/css"/>
    <link href="http://fonts.useso.com/css?family=Open+Sans:700" rel="stylesheet" type="text/css"/>
    <link href="http://fonts.useso.com/css?family=Droid+Sans:400" rel="stylesheet" type="text/css"/>
    <link href="http://fonts.useso.com/css?family=Droid+Sans:700" rel="stylesheet" type="text/css"/>
    <![endif]-->

    <!-- Favicon and touch icons -->
    <link rel="shortcut icon" href="../assets/ico/favicon.ico" type="image/x-icon"/>

    <!-- Css files -->
    <link href="../assets/css/bootstrap.min.css" rel="stylesheet">
    <link href="../assets/css/jquery.mmenu.css" rel="stylesheet">
    <link href="../assets/css/font-awesome.min.css" rel="stylesheet">
    <link href="../assets/plugins/jquery-ui/css/jquery-ui-1.10.4.min.css" rel="stylesheet">
    <link href="../assets/css/style.min.css" rel="stylesheet">
    <link href="../assets/css/add-ons.min.css" rel="stylesheet">
    <link href="../bootstrap-table-develop/dist/bootstrap-table.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- start: JavaScript-->
    <!--[if !IE]>-->

    <script src="../assets/js/jquery-2.1.1.min.js"></script>

    <!--<![endif]-->

    <!--[if IE]>

    <script src="../assets/js/jquery-1.11.1.min.js"></script>

    <![endif]-->

    <!--[if !IE]>-->

    <script type="text/javascript">
        window.jQuery || document.write("<script src='assets/js/jquery-2.1.1.min.js'>" + "<" + "/script>");
    </script>

    <!--<![endif]-->

    <!--[if IE]>

    <script type="text/javascript">
        window.jQuery || document.write("<script src='assets/js/jquery-1.11.1.min.js'>" + "<" + "/script>");
    </script>

    <![endif]-->
    <script src="../assets/js/jquery-migrate-1.2.1.min.js"></script>
    <script src="../assets/js/bootstrap.min.js"></script>


    <!-- page scripts -->
    <script src="../assets/plugins/jquery-ui/js/jquery-ui-1.10.4.min.js"></script>
    <script src="../assets/plugins/datatables/js/jquery.dataTables.min.js"></script>
    <script src="../assets/plugins/datatables/js/dataTables.bootstrap.min.js"></script>

    <!-- theme scripts -->
    <script src="../assets/js/SmoothScroll.js"></script>
    <script src="../assets/js/jquery.mmenu.min.js"></script>
    <script src="../assets/js/core.min.js"></script>

    <!-- bootstrap table -->
    <script src="../bootstrap-table-develop/dist/bootstrap-table.js"></script>
    <script src="../bootstrap-table-develop/dist/locale/bootstrap-table-zh-CN.js"></script>


    <!-- 配置文件 -->
    <script type="text/javascript" charset="utf-8" src="../ueditor-1.4.3.3/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="../ueditor-1.4.3.3/editor_api.js"></script>
    <!-- inline scripts related to this page -->
    <!--<script src="../assets/js/pages/table.js"></script>-->


    <!-- end: JavaScript-->
</head>
</head>

<body>
<!-- start: Header -->
<div class="navbar" role="navigation">

    <div class="container-fluid">

        <ul class="nav navbar-nav navbar-right">

            <li><a href="/logout"><i class="fa fa-power-off"></i></a></li>
        </ul>

    </div>

</div>
<!-- end: Header -->

<div class="container-fluid content">

    <div class="row">

        <!-- start: Main Menu -->
        <div class="sidebar ">

            <div class="sidebar-collapse">
                <div class="sidebar-header t-center">
                    <span><img class="text-logo" src="../assets/img/logo1.png"><i
                            class="fa fa-space-shuttle fa-3x blue"></i></span>
                </div>
                <div class="sidebar-menu">
                    <ul class="nav nav-sidebar">
                        <li><a href="/articleManager/index"><i class="fa fa-laptop"></i><span class="text"> 信息管理</span></a></li>
                        <li><a href="/introManager/list"><i class="fa fa-laptop"></i><span class="text"> 介绍管理</span></a></li>

                    </ul>
                </div>
            </div>
            <div class="sidebar-footer">

                <div class="sidebar-brand">
                    Proton
                </div>
            </div>

        </div>
        <!-- end: Main Menu -->

        <!-- start: Content -->
        <div class="main sidebar-minified">

            <div class="row">
                <div class="col-lg-12">
                    <h3 class="page-header"><i class="fa fa-table"></i>文章添加</h3>
                    <ol class="breadcrumb">
                        <li><i class="fa fa-home"></i><a href="/articleManager/index">主页</a></li>
                        <li><i class="fa fa-table"></i>文章添加</li>
                    </ol>
                </div>
            </div>

            <div class="row">
                <div class="col-md-10">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h2><i class="fa fa-indent red"></i><strong>文章添加</strong></h2>
                        </div>
                        <div class="panel-body">
                            <form action="" method="post" enctype="multipart/form-data" class="form-horizontal ">
                                <div class="form-group">
                                    <label class="col-md-3 control-label">ID</label>
                                    <div class="col-md-9">
                                        <p id="o_id" class="form-control-static"></p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-3 control-label" for="o_mc">信息名称</label>
                                    <div class="col-md-9">
                                        <input id="o_mc" type="text"  name="text-input" class="form-control" placeholder="Text">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-md-3 control-label" for="o_fl">信息分类</label>
                                    <div class="col-md-9">
                                        <select id="o_fl" name="select" class="form-control" size="1">
                                            <option value="1">公益活动</option>
                                            <option value="2">企业刊物</option>
                                            <option value="3">政策解读</option>
                                            <option value="4">涉税筹划</option>
                                            <option value="5">政策法规</option>
                                            <option value="6">公司新闻</option>
                                            <option value="7">行业资讯</option>
                                            <option value="8">视频新闻</option>
                                            <option value="9">专业文章</option>
                                            <option value="10">相关法规</option>
                                            <option value="11">视频资料</option>
                                            <option value="12">服务范围</option>
                                        </select>
                                    </div>
                                </div>

                               <!-- <div class="form-group">
                                    <label class="col-md-3 control-label" for="o_pic_path">新闻图片</label>
                                    <div class="col-md-9">
                                        <img id="o_pic_path" src="" alt="none" height="200px">
                                    </div>
                                </div>-->

                                <!--<div class="form-group">
                                    <label class="col-md-3 control-label" for="file-input">修改图片</label>
                                    <div class="col-md-9">
                                        <input id="o_pic"  type="file" name="o_pic">
                                    </div>
                                </div>-->

                                <div class="form-group">
                                    <label class="col-md-3 control-label" for="o_wh">文号</label>
                                    <div class="col-md-9">
                                        <input id="o_wh" type="text"  name="o_wh" class="form-control">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-md-3 control-label" for="o_rq">发布日期</label>
                                    <div class="col-md-9">
                                        <input id="o_rq" type="text"  name="o_rq" class="form-control" readonly="readonly">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-md-3 control-label" for="o_rq">内容</label>
                                    <div class="col-md-9">
                                        <!-- 加载编辑器的容器 -->
                                        <script id="o_nr" name="content" type="text/plain">
                                            这里写你的初始化内容
                                        </script>
                                        <!-- 实例化编辑器 -->
                                        <script type="text/javascript">
                                            var ue = UE.getEditor('o_nr',{
                                                //这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
                                                toolbars:[['FullScreen', 'Source', 'Undo', 'Redo','Bold','test','simpleUpload']],
                                                //focus时自动清空初始化时的内容
                                                autoClearinitialContent:true,
                                                //关闭字数统计
                                                wordCount:false,
                                                //关闭elementPath
                                                elementPathEnabled:false,
                                                //默认的编辑区域高度
                                                initialFrameHeight:300
                                                //更多其他参数，请参考ueditor.config.js中的配置项
                                            });
                                        </script>
                                    </div>

                                </div>

                                <br>
                            </form>
                        </div>
                        <div class="panel-footer">
                            <button id="update" type="button" class="btn btn-sm btn-success"><i class="fa fa-dot-circle-o"></i> 保存</button>
                            <!--<button type="reset" class="btn btn-sm btn-danger"><i class="fa fa-ban"></i> Reset</button>-->
                        </div>
                    </div>
                </div>

            </div>
            <!-- end: Content -->
            <br><br><br>

        </div><!--/container-->

        <div class="clearfix"></div>


        <script>

            $(function () {
                // 保存文章信息
                $('#update').click(function () {
                    var o_mc = $('#o_mc').val();
                    var o_fl = $('#o_fl').val();
                    var o_wh = $('#o_wh').val();
                    var o_nr = ue.getContent();
                    //console.log(o_id, o_mc, o_fl, o_wh, o_nr);

                    $.ajax({
                        type: 'POST',
                        url: '/articleManager/add',
                        data: {
                            o_mc: o_mc,
                            o_fl: o_fl,
                            o_wh: o_wh,
                            o_nr: o_nr
                        },
                        success: function () {
                            alert("保存成功");
                        },
                        error: function () {
                            alert("保存失败");
                        }
                    });

                });
            });

            // 获取url参数
            function GetQueryString(name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
                var r = window.location.search.substr(1).match(reg);
                if (r != null)return unescape(r[2]);
                return null;
            }
            //console.log(GetQueryString("o_id"));
        </script>
    </div>
</div>
</body>
</html>